.toc {
  margin: 16px 0;
  padding-inline-start: 0;
  font-size: 12px;
  list-style: none;
  border-inline-start: 1px solid @site-border-color-split;
}

ul.toc > li {
  margin-inline-start: 0;
  padding-inline-start: 0;
  line-height: 1.5;
  list-style: none;

  &:not(:last-child) {
    margin-bottom: 4px;
  }
}

.toc li > ul {
  display: none;
  font-size: 12px;
  text-indent: 8px;
}

.toc a {
  display: block;
  width: 110px;
  margin-inline-start: -1px;
  padding-inline-start: 16px;
  overflow: hidden;
  color: @site-text-color;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-inline-start: 1px solid transparent;
  transition: all 0.3s ease;
}

.toc a:hover {
  color: @primary-color;
}

.toc a.current {
  color: @primary-color;
  border-color: @primary-color;
}

.toc-affix {
  position: absolute;
  top: 8px;
  inset-inline-end: 20px;

  .ant-affix {
    z-index: 9;
    max-height: ~'calc(100vh - 16px)';
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
  }
}
